<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
<!--    ./public-->
    <link rel="icon" href="/favicon.ico">
    <!-- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + Vue + TS</title>
  </head>

  <script type="notjs" id="vertex-shader">

      attribute vec2 a_position;
      uniform vec2 u_resolution; // 分辨率

      // (1928,1680) # (0,0)
      void main(){
        // [0, 1] 之间
        vec2 zeroToOne = a_position / u_resolution;
        // [0, 2]
        vec2 zeroToTwo = zeroToOne * 2.0;
        // [-1,1]
        vec2 clipSpace = zeroToTwo - 1.0;

        gl_Position =vec4(clipSpace * vec2(1,-1), 0, 1);

      }
       /*

      attribute vec3 a_position;
      void main (){
        gl_Position = vec4(a_position, 1);
      }
      */
  </script>

  <script type="notjs" id="fragment-shader">

        precision mediump float;
        uniform vec4 u_color;
        void main(){
          gl_FragColor =u_color;
        }
            /*
      void main(){
        gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
      }
         */
  </script>

  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>
